/*
 * ALDevice.h
 *
 *  Created on: 2009/01/31
 *      Author: Yongshik Cho
 */

#ifndef ALDEVICE_H_
#define ALDEVICE_H_

#include "../core/Prerequisites.h"
#include "../AudioDevice.h"

class ALDevice : public AudioDevice
{
public:
	static const std::string _DEFAULT_DEVICE;
	static const int32 _NUM_BUFFERS			= 32;

public:
	ALDevice(DeviceSettings* sets);
	virtual ~ALDevice();

public:
	virtual Sound* createSound(const String& p, const uint32 format, const int32 rate, void* stream);
	virtual void disposeSound(Sound* sound);
	virtual void cleanupSounds();
	virtual void playback(Audible* a, const Vector2D& position);
	virtual bool isPlaying(Audible* a);
	virtual uint32 getPlayStatus(Audible* a);
	virtual void queueStream(Sound* sound, int8* cbuf, const int32 size);

private:
	void init();
	void Release();
	void checkError();

private:
	DeviceSettings*		mSettings;
};

#endif /* ALDEVICE_H_ */
